import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/static/home',
  },
  {
    path: '/static',
    name: 'StaticMenu',
    component: () => import('@/views/StaticMenu'),
    children: [
      {
        path: 'home',
        components: {
          default: () => import('@/components/HomeStream'),
          helper: () => import('@/components/StaticHome'),
        }
      },
      {
        path: 'code',
        name: 'CodeHome',
        component: () => import('@/components/CodeLibrary/CodeHome')
      },
      {
        path: 'music',
        name: 'MusicHome',
        component: () => import('@/components/MusicLibrary/MusicHome')
      },
      {
        path: 'photos',
        name: 'PhotosHome',
        component: () => import('@/components/PhotosLibrary/PhotosHome')
      },
      {
        path: 'writing',
        name: 'WritingHome',
        component: () => import('@/components/WritingLibrary/WritingHome')
      },
      {
        path: 'movie',
        name: 'MovieHome',
        component: () => import('@/components/MovieLibrary/MovieHome')
      },
      {
        path: 'exhibition',
        name: 'ExhibitionHome',
        component: () => import('@/components/OnlineExhibition/ExhibitionHome')
      }
    ]
  },
  {
    path: '/star',
    name: 'StarMap',
    component: () => import('@/components/StarPuzzleRoom/StarMap')
  }
]

const router = new VueRouter({
  mode : 'history',
  base : process.env.BASE_URL,
  routes
})

export default router
